package com.cc.service;  
  
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cc.dao.InstituteMapper;
import com.cc.dao.MajorMapper;
import com.cc.dao.UserDao;
import com.cc.dao.UserSchoolMapper;
import com.cc.dao.UserStudentMapper;
import com.cc.entity.Institute;
import com.cc.entity.Major;
import com.cc.entity.User;
import com.cc.entity.UserSchool;
import com.cc.entity.UserStudent;  
  
@Service("userService")  
public class FnService{  
    @Resource  
    private UserSchoolMapper userSchoolDao;
    @Resource  
    private InstituteMapper instituteDao;
    @Resource  
    private MajorMapper majorDao;
    @Resource  
    private UserStudentMapper userStudentDao;
    
    
    public List<UserSchool> getSchoolList(){
    	List<UserSchool> data=new ArrayList<>();
    	data=userSchoolDao.selectAllSchool();
    	return data;
    }
    public List<Institute> selectBySchoolid(String schoolid){
    	List<Institute> data=new ArrayList<>();
    	data=instituteDao.selectBySchoolid(schoolid);
    	return data;
    }
    public List<Major> selectByinsid(String insid){
    	List<Major> data=new ArrayList<>();
    	data=majorDao.selectByIns(insid);
    	return data;
    }
    
    public UserStudent getCurrentUserStudent(UserStudent userStudent){
    	return userStudentDao.selectUserStudentByUsername(userStudent);
    }
    
}
